package com.example.native_image_plugin

import android.content.Context
import android.view.View
import android.widget.ImageView
import com.bumptech.glide.Glide
import io.flutter.plugin.platform.PlatformView

class NativeImageView(private var mContext: Context?, private var imgPath: String) : PlatformView {
    var img:ImageView?= null
    override fun getView(): View {
        img = ImageView(mContext)
        Glide.with(mContext!!).load(imgPath)
                .centerCrop()
                .thumbnail(0.3f)
                .into(img!!)
        return img!!
    }

    override fun dispose() {
        img = null
    }
}